﻿using MarkdownWeb.Models;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;

namespace MarkdownWeb.Controllers
{
    public class TestController : Controller
    {
        // GET: Test
        public ActionResult Index()
        {
            return View();
        }
        
        [HttpPost]
        public JsonResult Test()
        {

            var Data = new TestModel { name = "张三", age = 18 };
            var content = new JsonResult();
            
            content.Data = Data;//JsonConvert.SerializeObject(Data);
            content.ContentEncoding = Encoding.UTF8;
            content.ContentType = "json";
            //content.
            return content;
            //return ret;
        }
    }
}